<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="p" uri="/WEB-INF/tld/page.tld" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>交账管理</title>
<jsp:include page="/header.jsp"></jsp:include>
<link href="${basePath }/css/ui.css" rel="stylesheet" type="text/css">
<script type="text/javascript">
	function dealDiff(id) {
		$.jqconfirm("你确定没问题了么？", "提示", function() {
			$.ajax({
				url:"${basePath}/shift/diffConfirm.htm?id="+id,
				dataType:"json"
			}).done(function(data) {
				$.jqalert(data.msg, function() {
					if(data.isSuccess)
						window.location = window.location;
				});
			})
		})
	}
</script>
</head>
<body>
	<div id="header_div" class="tab_li clearfix">
		<a href="${basePath }/shift/takeStock.htm" class="">下班盘点</a>
	    <a href="${basePath }/shift/summary.htm" class="">交账管理</a>
	    <a href="${basePath }/shift/takeStockdiff.htm" class="act">差异商品</a>
	    <a href="${basePath }/shift/check_view.htm" class="">上班核实</a>
	    <a href="${basePath }/shift/list.htm" class="">交班记录</a>
	</div>
	<div class="main">
	    <div class="cont">
    	<div class="main">
        <div class="cont">
        	<div class="ui">
		        <table class="table_list">
		            <tr class="">
		              <th class="">序号</th>
		              <th>类别</th>
		              <th class="">产品名称</th>
		              <th class="">二维码</th>
		              <th class="">生产年份</th>
		              <th class="">产品批次</th>
		              <th class="">类型</th>
		              <th class="">规格</th>
		              <th class="">商品所在区域</th>
		              <th class="">操作时间</th>
		              <th class="">操作人</th>
		              <th class="">状态</th>
		              <th class="">操作</th>
		            </tr>
		            <c:forEach items="${diffs }" var="diff" varStatus="status">
		            <tr class="">
		              <td class="">${status.index+1 }</td>
		              <td class="">${diff.product.sort_display }</td>
		              <td class="">${diff.product.name }</td>
		              <td class="">${diff.qrcode }</td>
		              <td class="">${diff.product.productionyear }</td>
		              <td class="">${diff.product.batch }</td>
		              <td class="">${diff.qrcodeMap.unit }</td>
		              <td class="">${diff.product.spec.amount }${diff.product.spec.unit }/${diff.product.spec.bigunit }</td>
		              <td class="">${diff.shelf_name }</td>
		              <td class="">${diff.oper_time }</td>
		              <td class="">${diff.user_name }</td>
		              <td class="">${diff.status_display }</td>
		              <td class="">
		              	<c:if test="${diff.status eq 0 }">
		              		<a href="javascript:;" onclick='dealDiff("${diff.id}")'>处理</a>
		              	</c:if>
		              </td>
					</tr>
		            </c:forEach>
		        </table>
    		</div>	
    	</div>
    </div>
    <p:page map="${page }"></p:page>
</div>
</div>
</body>
</html>